package com.qwt.part_time_api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qwt.part_time_api.mapper.SpeciesMapper;
import com.qwt.part_time_api.pojo.Species;
import com.qwt.part_time_api.service.SpeciesService;
import com.qwt.part_time_api.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 君子慎独
 * @create 2021/12/25 0025 21:51
 */

@Service
@Slf4j
public class SpeciesServiceImpl implements SpeciesService {

    @Autowired
    private SpeciesMapper speciesMapper;

    @Override
    public Result findAllSpecies() {
        log.info("获取所有种类");
        LambdaQueryWrapper<Species> wrapper = new LambdaQueryWrapper<>();
        List<Species> species = speciesMapper.selectList(wrapper);
        return Result.success(species);
    }
}
